package org.gd.hellojavacore.patterns.singleton;

import org.gd.hellojavacore.patterns.CreationalPattern;

/**
 ленивая несинхронизированная реализация
 */
@SuppressWarnings("unused")
public class LazySingleton implements Singleton {

    private static LazySingleton instance;

    private LazySingleton (){
    }

    public static LazySingleton getInstance(){
        if (instance == null){
            instance = new LazySingleton();
        }
        return instance;
    }
}
